$.fn.api.settings.api = {
	'UserManagerList' : '/query-system/list?page={page}&limit={limit}',
	'TestUserManagerList' : '/query-system/list?page="+this.page+"limit="+this.limit',
	'Add User' : '/query-system/addUser'
};
var userInfoVm= new Vue({
	el : '#infoUserDialog',
	data : {
		list : {},
		selectedId:1
	},
	computed : {
		
	},
	methods : {
		
	}
});


var vm = new Vue({
	el : '#usertable',
	data : {
		tablethList : [ '标识符', '账户', '性别', '用户名', '用户状态' ],
		tabletdList : [],
		total : 1,
		page : 1,
		limit : 2,
		order : "order"
	},
	computed : {
		pageSize : function() {
			return Math.ceil(this.total / this.limit);
		}
	},
	methods : {
		loadList : function() {
			$.ajax({
				type : "get",
				url : "/query-system/list",
				success : function(r) {
					if (r.code == 0) {
						console.log(r);
						vm.tabletdList = r.page.list;
						console.log(vm.tabletdList);
					} else {
						dialog = jqueryAlert({
							'style' : 'wap',
							'modal' : true,
							'content' : '此用户不存在或者密码错误',
							'buttons' : {
								'确定' : function() {
									dialog.close();
								}
							},
							'closeTime' : 1000,
						});
						if (dialog) {
							return dialog.show();
						}
					}
				}
			});
		}
	},
	created : function() {
		this.loadList();
	}
});
/*
 * $('#addUserButton').api({ action : 'Add User', method : 'get', serializeForm :
 * true, on : 'mouseenter', onSuccess : function(result) { if (result.code == 0)
 * {// 登录成功 console.log(result); } else { dialog = jqueryAlert({ 'style' :
 * 'wap', 'modal' : true, 'content' : '此用户不存在或者密码错误', 'buttons' : { '确定' :
 * function() { dialog.close(); } }, 'closeTime' : 1000, }); if (dialog) {
 * return dialog.show(); } } } });
 */
$('#alterButton').click(function() {
	$('.ui.modal').modal('show');
});